{extend name="Layout/edit" /}
{block name="content"}
<!-- form start -->
<form action="{:url('editSave')}" method="post" class="form-horizontal">
    <div class="box-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10">
                <input type="text" name="title" class="form-control input-sm" placeholder="标题" value="{$data.title}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">链接</label>                        
            <div class="col-sm-10">
                <input type="text" name="link_url" class="form-control input-sm" placeholder="链接" value="{$data.link_url}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">图片</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" name="image_url" class="form-control input-sm"  placeholder="图片" value="{$data.image_url}">
                    <span class="input-group-btn">
                        <a href="{:url('Uploader/delete')}" class="btn btn-default btn-sm xsui-btn-singlefile-delete-image" title="删除图片">删除</a>
                        <a href="{:url('Uploader/single_file','name=image_url')}" class="btn btn-default btn-sm xsui-btn-singlefile-uploader-image" title="选择图片并上传">上传</a>
                    </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">备注</label>
            <div class="col-sm-10">
                <input type="text" name="remark" class="form-control input-sm"  placeholder="备注信息" size="79" value="{$data.remark}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                {xshtml:radio name="status" data='array("1"=>"显示","0"=>"隐藏")' value="data['status']|default='1'" /}
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
        <button type="submit" class="btn btn-primary pull-right">保存</button>
        <input type="hidden" name="id" value="{$data.id}"/>
    </div>
    <!-- /.box-footer -->
</form>
{/block}
{block name="script_after"}
<script>
    $('select[name="category_id"]').ajaxcombobox({first:{id:"",text:"选择类别"}});
</script>
{/block}